package cn.cw.itsource.web;

import cn.cw.itsource.entity.User;
import cn.cw.itsource.mapper.UserMapper;
import cn.cw.itsource.result.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserMapper userMapper;

    @GetMapping("/list")
    public JSONResult list() {
        List<User> users = userMapper.selectAll();
        return JSONResult.success(users);
    }
}
